﻿using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace MuHelper.Tests
{
    [TestClass]
    public class MeasureIsEquivalentTo
    {
        [TestMethod]
        public void BaseMeasureIsEquivalentToBaseMeasure()
        {
            var measure1 = new Measure("m");
            var measure2 = new Measure("g");
            Assert.IsTrue(measure1.IsEquivalentTo(measure1));
            Assert.IsFalse(measure1.IsEquivalentTo(measure2));
        }

        [TestMethod]
        public void BaseMeasureIsEquivalentToComplexMeasure()
        {
            var measure1 = new Measure("m");
            var measure2 = new Measure("m_", 1, new Dictionary<string, decimal> {{"m", 1}});
            Assert.IsTrue(measure1.IsEquivalentTo(measure2));
            Assert.IsTrue(measure2.IsEquivalentTo(measure1));
        }

        [TestMethod]
        public void ComplexMeasureToComplexMeasure()
        {
            var measure1 = new Measure("m_", 1, new Dictionary<string, decimal> {{"m", 1}});
            var measure2 = new Measure("g_", 1, new Dictionary<string, decimal> {{"g", 1}});

            Assert.IsTrue(measure1.IsEquivalentTo(measure1));
            Assert.IsFalse(measure1.IsEquivalentTo(measure2));
        }
    }
}
